function Promise(executor){
	// 状态
	this.state="pending";
	// 状态值
	this.result = undefined;
	// 子函数一般以下划线开头
	const _onChangeStateAndResult = function(state,value){
		if(this.state !== "pending") return;
		// 设置状态
		this.state = state;
		// 设置状态值
		this.result = value;
	}
	try{
		executor(_onChangeStateAndResult.bind(this,"fulfilled"),_onChangeStateAndResult.bind(this,"rejected"));
	}catch (err){
		_onChangeStateAndResult.call(this,"rejected",err);
	}
}
export default Promise;